import {save_title,save_todo_count} from "../../constant/baseConstant";

const init = {
    title:'',
    todoCount:0
}
export default function todoReducer(preState=init,action){
    const {type,data} = action
    switch (type) {
        case save_title:
            return {...preState,title: data}
        case save_todo_count:
            return {...preState,todoCount:data }
        default:
            return preState
    }
}